package signGrammar;

import java.awt.Graphics;
import java.awt.Point;

public class CExMultShapesExpression implements IShape{
	
	private IShape a,b;
	public CExMultShapesExpression(IShape a, IShape b) {
		this.a = a;
		this.b = b.cloneForHead(a.getHead());
	}
	
	@Override
	public IShape print(Graphics graphics) {
		a.print(graphics);
		b.print(graphics);
		return this;
	}

	@Override
	public Point getHead() {
		return b.getHead();
	}

	@Override
	public Point getTail() {
		return a.getTail();
	}

	@Override
	public IShape cloneForHead(Point startPoint) {
		return new CExMultShapesExpression(a.cloneForHead( b.cloneForHead(startPoint).getHead() ),b);
	}

	@Override
	public IShape cloneForTail(Point endPoint) {
		return new CExMultShapesExpression( a.cloneForTail(endPoint), b);
	}
}
